package com.ouheng.shop.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

import com.ouheng.shop.dao.ProductProductGroupDao;
import com.ouheng.shop.domain.ProductProductGroupDO;
import com.ouheng.shop.service.ProductProductGroupService;



@Service
public class ProductProductGroupServiceImpl implements ProductProductGroupService {
	@Autowired
	private ProductProductGroupDao productProductGroupDao;
	
	@Override
	public ProductProductGroupDO get(Long id){
		return productProductGroupDao.get(id);
	}
	
	@Override
	public List<ProductProductGroupDO> list(Map<String, Object> map){
		return productProductGroupDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return productProductGroupDao.count(map);
	}
	
	@Override
	@Transactional
	public int save(ProductProductGroupDO productProductGroup){
		return productProductGroupDao.save(productProductGroup);
	}
	
	@Override
	@Transactional
	public int update(ProductProductGroupDO productProductGroup){
		return productProductGroupDao.update(productProductGroup);
	}
	
	@Override
	@Transactional
	public int remove(Long id){
		return productProductGroupDao.remove(id);
	}
	
	@Override
	@Transactional
	public int batchRemove(Long[] ids){
		return productProductGroupDao.batchRemove(ids);
	}

	@Override
	public int removeByProductid(Long pid) {
		// TODO Auto-generated method stub
		return productProductGroupDao.removeByProductid(pid);
	}

	@Override
	public int removeByGroupid(Long groupid) {
		// TODO Auto-generated method stub
		return productProductGroupDao.removeByGroupid(groupid);
	}

	@Override
	public List<Long> listProductidByGroupid(Long groupid) {
		// TODO Auto-generated method stub
		return productProductGroupDao.listProductidByGroupid(groupid);
	}
	
}
